package core.beanpostprocessor;

import bjut.core.bean.BeanDefinition;
import bjut.core.exception.BeansException;
import bjut.core.factory.ConfigurableListableBeanFactory;
import bjut.core.postprocessor.BeanFactoryPostProcessor;
import bjut.core.property.PropertyValue;
import bjut.core.property.PropertyValues;

/**
 * @Author: zhuzhiming
 * @Date: 2022/6/30 19:49
 */
public class MyBeanFactoryBeanPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

        BeanDefinition userService = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = userService.getPropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("company","华为"));

    }
}
